import type { TableColumn } from '@/components/core/dynamic-table';

export type TableListItem = API.UserListPageResultItem;
export type TableColumnItem = TableColumn<TableListItem>;

import { getTableListApi } from '@/api/system/role';

/**
 * 将对应菜单类型转为字符串字意
 */
const getSexType = (type) => {
  switch (type) {
    case 1:
      return '男';
    case 2:
      return '女';
    default:
      return '-';
  }
};

export const baseColumns: TableColumn[] = [
  {
    title: '关键字',
    align: 'left',
    dataIndex: 'keyword',
    hideInTable: true,
    formItemProps: {
      labelWidth: 55,
      componentProps: () => {
        return {
          placeholder: '可输入耗材编号、名称搜索',
          disabledLabelWidth: true,
        };
      },
    },
  },
  {
    title: '耗材编号',
    align: 'left',
    dataIndex: 'userName',
    hideInSearch: true,
  },
  {
    title: '耗材信息',
    align: 'left',
    dataIndex: 'userLogin',
    hideInSearch: true,
  },

  {
    title: '库存量',
    align: 'left',
    dataIndex: 'deptName',
    hideInSearch: true,
  },
  {
    title: '库存预警',
    align: 'left',
    dataIndex: 'roleName',
    hideInSearch: true,
  },
  {
    title: '保质期',
    align: 'left',
    dataIndex: 'roleType',
    hideInSearch: true,
  },
];
export const innerColumns: TableColumn[] = [
  {
    title: '批次号',
    align: 'left',
    dataIndex: 'userName',
    hideInSearch: true,
  },
  {
    title: '到期时间',
    align: 'left',
    dataIndex: 'userLogin',
    hideInSearch: true,
  },

  {
    title: '库存数量',
    align: 'left',
    dataIndex: 'deptName',
    hideInSearch: true,
  },
  {
    title: '单价',
    align: 'left',
    dataIndex: 'roleName',
    hideInSearch: true,
  },
];
